Completed
Push — master ( c2dace...6a420e )
by Nicolas
25s queued 10s
created

QuoteItem.getAmountExcludingVat   A

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
1
import {Entity, Column, PrimaryGeneratedColumn, ManyToOne} from 'typeorm';
2
import {Quote} from './Quote.entity';
3
4
@Entity()
5
export class QuoteItem {
6
  @PrimaryGeneratedColumn('uuid')
7
  private id: string;
8
9
  @Column({type: 'varchar', nullable: false})
10
  private title: string;
11
12
  @Column({type: 'integer', nullable: false})
13
  private quantity: number;
14
15
  @Column({type: 'integer', nullable: false})
16
  private dailyRate: number;
17
18
  @ManyToOne(
19
    type => Quote,
20
    quote => quote.items,
21
    {nullable: false}
22
  )
23
  quote: Quote;
24
25
  constructor(
26
    title: string,
27
    quantity: number,
28
    dailyRate: number,
29
    quote: Quote
30
  ) {
31
    this.title = title;
32
    this.quantity = quantity;
33
    this.dailyRate = dailyRate;
34
    this.quote = quote;
35
  }
36
37
  public getTitle(): string {
38
    return this.title;
39
  }
40
41
  public getDailyRate(): number {
42
    return this.dailyRate;
43
  }
44
45
  public getQuantity(): number {
46
    return this.quantity;
47
  }
48
}
49